package com.hyzh.latte.vehicle.dmo;

import com.hyzh.latte.util.gather.EarlyWarningPublicDTO;
import com.hyzh.latte.vehicle.dmo.entity.ParkPGEntity;
import lombok.*;

import java.io.Serializable;

/**
 * 和算法 对接
 * 人员轨迹数据 需要商定
 * @author songkui
 * @since 2024/3/20 14:05
 */
@Getter
@Setter
@NoArgsConstructor
@ToString
@AllArgsConstructor
@EqualsAndHashCode(of = {"lon", "lat"})
public class PersonGatherDTO implements Serializable {

    private Integer personNum;  //人数
    private String lon;   // 经度度
    private String lat;   // 维度


    public EarlyWarningPublicDTO buildEarlyWarningPublicDTO(ParkPGEntity parkPGEntity){
        EarlyWarningPublicDTO dto = new EarlyWarningPublicDTO();
        dto.setParkCode(parkPGEntity.getFormalCode());
        dto.setLatitude(this.lat);
        dto.setLongitude(this.lon);

        return dto;
    }

    public String key(){
        return lon+":"+lat;
    }

}
